package com.example.behaviour.customization.observer.publisher;

import com.example.behaviour.customization.observer.event.AppEvent;
import com.example.behaviour.customization.observer.multicaster.AppEventMulticaster;

/**
 * 简单事件发布者
 */
public class SimpleEventPublisher implements AppEventPublisher{

    private AppEventMulticaster appEventMulticaster;

    public void setAppEventMulticaster(AppEventMulticaster appEventMulticaster) {
        this.appEventMulticaster = appEventMulticaster;
    }

    @Override
    public void publishEvent(AppEvent event) {
        appEventMulticaster.multicasterEvent(event);
    }
}
